<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>box</title>
	<style type="text/css">
	.box{
		width: 200px;
		height: 200px;
		background: blue url() 0 0 no-repeat;
		overflow: scroll;
	}
	.time{
		width: 100px;
		height: 50px;
		background: yellow url() 0 0 no-repeat;
	}
	</style>
</head>
<body>
	<div class="box" id="box">
		sddfdfdfdfdsfdsfds
		sddfdfdfdfdsfdsfds
		sddfdfdfdfdsfdsfds
		sddfdfdfdfdsfdsfds
		sddfdfdfdfdsfdsfds
		sddfdfdfdfdsfdsfds
		sddfdfdfdfdsfdsfds
		sddfdfdfdfdsfdsfds
		sddfdfdfdfdsfdsfds
		sddfdfdfdfdsfdsfds
		sddfdfdfdfdsfdsfds
		sddfdfdfdfdsfdsfds
		sddfdfdfdfdsfdsfds
		<span>sddfdfdfdfdsfdsfds</span>	
	</div>
	<div class="time" id="time">
	</div>

<!-- 表单事件 -->
<!-- 	<form action="" onsubmit="alert('1232')">
		姓名：<input type="text" id="name">
		密码：<input type="password" id="password">
		<input type="submit" value="注册">
	</form> -->

	<script type="text/javascript" src='./js/main.js'>//根据加载顺序，js要写到所建类下面，否则计算机会先读取js而读取不到所建类对象。


// //倒计时5秒后跳转百度
// 	var box1=document.getElementById('time');
// 	str='秒后跳转到百度';
// 	num=5;
// 	function djs(){
// 		box1.innerText=str+num;
// 		if (num==0) {
// 			location.href="http://www.baidu.com"
// 		};//秒数为0时跳转
// 		num--;//倒计时
// 	}
// 	var time1=setInterval(djs, 1000);//指针，倒计时5秒后跳转百度


//抓取box
	var box =document.getElementById('box');
	// alert(box.setAttribute('class','box1'));//用box1替换原来的box，可以在浏览器查看元素中看到
	// alert(box.innerHTML);//抓取对象（盒子）中的文字和标签类型
	// alert(box.innerText); //抓取对象（盒子）中的文字
//抓取time
	var time=document.getElementById('time');
	</script>
</body>
</html>